package com.demo.controller;

import com.demo.dto.Result;
import com.demo.entity.ShopType;
import com.demo.service.IShopTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/shop-type")
public class ShopTypeController {

    @Resource
    private IShopTypeService shopTypeService;

    @GetMapping("list")
    public Result queryTypeList(){
        //orderByAsc 升序排列 sort字段为序号
        List<ShopType> list = shopTypeService.query().orderByAsc("sort").list();
        return Result.ok(list);
    }
}
